package com.qfedu.zf.user.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qfedu.zf.common.vo.R;
import com.qfedu.zf.user.entity.Browse;
import com.qfedu.zf.user.mapper.BrowseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zym
 * @since 2024-06-21
 */
@RestController
@RequestMapping("/browse")
public class BrowseController {

    @Autowired
    private BrowseMapper browseMapper;
    @RequestMapping("/list")
    public R selectList(@RequestParam("id") Integer id){
        QueryWrapper<Browse> browseQueryWrapper = new QueryWrapper<>();
        browseQueryWrapper.eq("listing_id",id);// 查询该房源id对应的所有浏览记录
        return R.ok(browseMapper.selectList(browseQueryWrapper));
    }
}

